<template>
  <div class="sidebar-user-container">
    <img v-if="avatar" :src="avatar" class="user-avatar">
    <img v-else src="@/assets/noBody.png" class="user-avatar">
    <div class="user-info">
      <div class="user-name">{{ name }}</div>
      <div class="dept-name">{{ deptName }}</div>
    </div>
  </div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
  name: 'UserInfo',
  computed: {
    ...mapGetters(['avatar', 'name', 'deptName'])
  },
  methods: {}
}

</script>
<style lang="scss" scoped>
  .sidebar-user-container{
    display:flex;
    align-items:center;
    margin-bottom:10px;
    .user-avatar {
      width:44px;
      height:44px;
      border-radius:100%;
      margin-right:10px;
    }
    .user-info{
      line-height:20px;
      .user-name{
        margin-bottom: 5px;
        margin-top:3px;
        font-size:17px;
        color: #333333;
      }
      .dept-name{
        font-size:14px;
        color: #555;
      }
    }
  }
</style>
